package fun.codedesign.jdk.math.fibonacci;

import java.util.Scanner;

/**
 * Fibonnacci
 * 1   1  2  3  5  8  13  21  34
 */

public class FibonnacciMethodDemo1 {
    public static void main(String[] args) {
        try(Scanner sc = new Scanner(System.in)) {
            System.out.print("输入数字:");
            int input = sc.nextInt();
            System.out.println("Fibonnacci:" + FibonnacciMethodDemo1.fib(input));
        }
    }

    public static int fib(int num) {
        int[] ary = {1, 1, 2, 3, 5, 8, 13, 21, 34, 55};
        int a = 0;
        a = ary[num - 1];
        return a;
    }
}

